package org.seedltd.upms.mapper.sys;

import java.math.BigDecimal;
import java.util.Date;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.seedltd.core.base.IBaseMapper;
import org.seedltd.upms.model.sys.entity.SysStatistics;

/**
 * 统计数据库访问接口
 */
public interface SysStatisticsMapper extends IBaseMapper<SysStatistics> {
    @Select("select count(*) as userNumber FROM sys_user s where s.create_time > #{time}")
    Integer countUser(@Param("time") Date time);

    @Select("select count(*) as fishingOrder FROM detection_order t where t.create_time > #{time} and t.state = 15")
    Integer countOrder(@Param("time") Date time);

    @Select("select SUM(t.total_price) as fishingOrder from detection_order t where t.refund_flag = 0 and t.create_time > #{time} and t.state > 1")
    BigDecimal countPrice();
}
